// import React from 'react'
import { useRoutes, useLocation } from "react-router-dom"
import router from "./router"
import TabBar from './TabBar/TabBar'

export default function App() {
    const element = useRoutes(router)
    const location = useLocation()

    // 定义需要显示TabBar的路由数组
    const tabBarRoutes = ['/home', '/dynamic'];
    const showTabBar = tabBarRoutes.includes(location.pathname);
    return (
        <div>
            {element}
            <div>
                {showTabBar ? <TabBar /> : null}
            </div>
        </div>
    )
}
